//
//  HomeAdvertEntity.m
//  SXH
//
//  Created by 房 国生 on 15/6/29.
//  Copyright (c) 2015年 lyss. All rights reserved.
//

#import "HomeAdvertEntity.h"

@implementation HomeAdvertEntity
@synthesize url, album,activityId,is_business;

- (instancetype)initWithAttributes:(NSDictionary *)attributes
{
    self = [super init];
    if (!self) {
        return nil;
    }
    
    self.album = [NSString stringWithFormat:@"%@/%@", IMAGE_URL, [attributes valueForKeyPath:@"album"]];
    self.url = [attributes valueForKeyPath:@"url"];
    self.title = [attributes valueForKeyPath:@"title"];
    
    return self;
}

- (instancetype)initWithAttributesAttraction:(NSDictionary *)attributes
{
    self = [super init];
    if (!self) {
        return nil;
    }
    
    self.url = self.album = [NSString stringWithFormat:@"%@/%@", IMAGE_URL, [attributes valueForKeyPath:@"album1"]];
    self.activityId = [attributes valueForKeyPath:@"id"];
    self.is_business= [attributes valueForKeyPath:@"is_business"];
    
    return self;
}

@end
